package cn.wolfcode.trip.base.domain;

import cn.wolfcode.trip.base.util.JSONUtil;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Getter@Setter
@JsonIgnoreProperties("handler")
public class GoodStyle extends BaseDomain{
    public static final Integer STATE_HIDE = 0; //隐藏
    public static final Integer STATE_SHOW = 1; //显示

    private String classes;//类别名称

    private Integer state = STATE_SHOW ;//类别状态

    private List<Goods> list = new ArrayList<>();

    public String getStateName(){
        String msg = "显示";
        if (state == STATE_HIDE){
            msg = "隐藏";
        }
        return msg;
    }

    public String getJson() {
        Map<String, Object> map = new HashMap<>();
        map.put("id", id);
        map.put("classes" , classes);
        map.put("state" , state);
        return JSONUtil.toJSONString(map);
    }

}